package com.neardrug.mapper;

import com.neardrug.entity.Analysis;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface AnalysisMapper {


    public void insert(Analysis analysis);

    @Select("select * from tb_analysis where id=#{taskId}")
    public Analysis selectByTaskId(Integer taskId);


    @Select("select * from tb_analysis where user_id=#{id}")
    List<Analysis> selectAll(Integer id);

    @Select("select notes from tb_analysis where id=#{id}")
    String selectNotesById(Integer id);


    void updateAnalysis(Analysis analysis);

    @Select("select * from tb_analysis where user_id=#{id} and collect=1")
    List<Analysis> selectCollected(Integer id);

    void updateFinishTimeAndResults(Analysis temAnalysis);
}
